package com.bolang.onlycode.demo.designPatterns.observe;

/**
 * 客户端
 */
public class Client {
    public static void main(String[] args) {
        SubscriptionSubject subscriptionSubject = new SubscriptionSubject();
        /**
         * 创建微信用户
         */
        WeixinUser aa = new WeixinUser("AA");
        WeixinUser bb = new WeixinUser("BB");
        WeixinUser cc = new WeixinUser("CC");
        /**
         * 订阅公众号
         */
        subscriptionSubject.attach(aa);
        subscriptionSubject.attach(bb);
        subscriptionSubject.attach(cc);
        /**
         * 公众号发信息给用户
         */
        subscriptionSubject.notify("大唐帝国后半生");


    }

}
